package com.example.roadship;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RatingBar;
import android.widget.RatingBar.OnRatingBarChangeListener;
import android.widget.TextView;

public class SetRank extends Activity {    
    private EditText edtComment;
    private RatingBar rtngbar;
    private TextView txtShowRate,txtRatetxt;
    private Button btnSave;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activty_set_rank);
		txtShowRate=(TextView)findViewById(R.id.txtShowRank);
		rtngbar=(RatingBar)findViewById(R.id.setRankRatingBar);
		btnSave=(Button)findViewById(R.id.btnSetRank);
		edtComment=(EditText)findViewById(R.id.edttextComment);
		txtRatetxt=(TextView)findViewById(R.id.txtShowRankTxt);
		addListenerOnRatingBar();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activty_set_rank, menu);
		return true;
	}
	
	public void addListenerOnRatingBar() {
		
		rtngbar.setOnRatingBarChangeListener(new OnRatingBarChangeListener() {
				public void onRatingChanged(RatingBar ratingBar, float rating,boolean fromUser) {	
					txtRatetxt.setText("Oyunuz :");
					txtShowRate.setText(String.valueOf(rating));		 
				}
				
			});
		  }

}
